package com.example.ex_widget;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button btn_1 = (Button)findViewById(R.id.btn1);
        Button btn_2 = (Button)findViewById(R.id.btn2);
        Button btn_3 = (Button)findViewById(R.id.btn3);
        Button btn_4 = (Button)findViewById(R.id.btn4);

        //执行ListView活动
        btn_1.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                Intent intent = new Intent(MainActivity.this,Ex_ListView.class);
                startActivity(intent);
            }
        });

        //执行GridView活动
        btn_2.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                Intent intent = new Intent(MainActivity.this,Ex_GridView.class);
                startActivity(intent);
            }
        });

        //执行RecyclerView活动
        btn_3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });

        //执行Spinner活动
        btn_4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });

    }
}
